function [new_branch_data,timing_diff_all_mkt,timing_diff,timing_diff_bangkok,timing_diff_northern,timing_diff_southern,timing_diff_central,timing_diff_northeastern]=...
    timing_difff(comm_loc_model,comm_loc)
    
    load('region.mat');
    nmkt=size(comm_loc,1);
    nyear=size(comm_loc,2);
    
    year_open_data(1:nmkt,1)=999;
    for i=1:nmkt
        temp=find(comm_loc(i,:),1);
        if ~isempty(temp)
            year_open_data(i)=temp;
        end
    end
    new_branch_data=find(comm_loc(:,1)==0 & comm_loc(:,end)==1);
    new_branch_data_bangkok=intersect(index_bangkok,new_branch_data);
    new_branch_data_central=intersect(index_central,new_branch_data);
    new_branch_data_northern=intersect(index_northern,new_branch_data);
    new_branch_data_northeastern=intersect(index_northeastern,new_branch_data);
    new_branch_data_southern=intersect(index_southern,new_branch_data);


    year_open_model(1:nmkt,1)=999;
    for i=1:nmkt
        temp=find(comm_loc_model(i,:),1);
        if ~isempty(temp)
            year_open_model(i)=temp;
        end
    end
    
    gap=abs(year_open_data-year_open_model);gap(gap>10)=10;

    timing_diff_all_mkt(1:nmkt,1)=0;
    timing_diff_all_mkt(new_branch_data)=gap(new_branch_data);

    timing_diff=mean(gap(new_branch_data));
    timing_diff_bangkok=mean(gap(new_branch_data_bangkok));
    timing_diff_central=mean(gap(new_branch_data_central));
    timing_diff_northern=mean(gap(new_branch_data_northern));
    timing_diff_northeastern=mean(gap(new_branch_data_northeastern));
    timing_diff_southern=mean(gap(new_branch_data_southern));



end